package com.slz3.business.module.configManagement.conZoneType.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conZoneType.domain.ConZoneType;
import com.slz3.business.module.configManagement.conZoneType.domain.ConZoneTypeCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class ConZoneTypeResAtomic {

    public Mono<ServerResponse> add_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneType conZoneType) {
        return ConZoneTypeResSafeValid.add(req, conZoneType) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.add(req, conZoneType);
    }

    public Mono<ServerResponse> delete_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.delete(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneType conZoneType) {
        return ConZoneTypeResSafeValid.modify(req, conZoneType) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.modify(req, conZoneType);
    }

    public Mono<ServerResponse> info_$ConZoneTypeUpdateLock(ServerRequest req) {
        return ConZoneTypeResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.auditSubmit(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.audit(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.auditReject(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.usingEnable(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$ConZoneTypeUpdateLock(ServerRequest req, ConZoneTypeCondition conZoneTypeCondition) {
        return ConZoneTypeResSafeValid.usingDisable(req, conZoneTypeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTypeResExecutor.usingDisable(req);
    }
}
